import { Injectable } from '@angular/core';
import { TasksService } from '../tasks.service';

enum DayEnum {
    '一' = 1,
    '二',
    '三',
    '四',
    '五',
    '六',
    '日'
}

@Injectable()
export class DateService {

    constructor(private tasksService: TasksService) { }
    setDate(uiDate: any): void {
        var currentDate = new Date();
        uiDate.dateStr = `${currentDate.getFullYear()}年${currentDate.getMonth() + 1}月${currentDate.getDate()}日`;
        uiDate.dayStr = `星期${DayEnum[currentDate.getDay()]}`;
    }

}